<?php


namespace app\api\v1\graphQLModel\fieldType;


use GraphQL\Type\Definition\ObjectType;

class ApiListFieldType extends ObjectType
{
    public function __construct(array $config = [])
    {
        $config = $config ?: [
            'fields' => [
                'api_list' => [
                    'type' => self::listOf(new ApiListFieldType([
                        'name' => 'api_list',
                        'fields' => [
                            'api_name' => self::string(),
                            'api_url' => self::string(),
                            'api_icon' => self::string(),
                            'query' => self::string(),
                            'schema' => self::string(),
                        ]
                    ]))
                ],
                'total' => self::int(),
                'page' => self::int(),
                'msg' => self::string(),
                'code' => self::int()
            ]
        ];
        parent::__construct($config);
    }

}